<?php

namespace app\admin\controller;

use app\admin\model\TemplateModel;
use app\webapi\common\BaseController;
use think\App;
use think\facade\Request;

class SystemTemplate extends BaseController
{
    public function __construct(App $app)
    {
        parent::__construct($app);
    }

    public function index()
    {
        /**
         * 确定模板文件路径
         */
        $template_id = Request::param('template_id');
        $type = Request::param('type');
        $template = TemplateModel::where(['id' => $template_id])->find();
        $number = $template['number'];

        /**
         * 获取测试数据
         */

        $data = $template;

        return view($number . '/' . $type . '/index/index', ['data' => $data]);
    }
}